Skip to content

Add CD rollback + non-root Dockerfile examples#15

Merged
heznpc merged 1 commit intomainfrom
feat/cd-rollback-nonroot
Apr 23, 2026
Merged

Add CD rollback + non-root Dockerfile examples#15
heznpc merged 1 commit intomainfrom
feat/cd-rollback-nonroot

Conversation

@heznpc
Copy link
Copy Markdown
Member

@heznpc heznpc commented Apr 23, 2026

Summary

Two hardening improvements for the deploy pipeline and example Dockerfiles.

CD rollback (.github/workflows/cd.yml)

  • Captures the currently running image tag on the VPS before the new deploy.
  • If docker compose up -d --wait fails the health check, rewrites the compose file with the previous tag and restarts.
  • Result: failed deploys self-recover to the last known-good image instead of leaving the service down.

Non-root USER in examples (docs/DOCKERFILE_EXAMPLES.md)

  • Adds a non-root USER app directive to the Python, Go, Rust, and Java examples, matching the existing Node example's USER node pattern.
  • 4 languages now ship secure-by-default examples.

Test plan

  • Lint (hadolint) passes on updated Dockerfile examples.
  • YAML lint passes on cd.yml.
  • Manual read-through of rollback logic.

- cd.yml: capture previous running image before deploy; on --wait
  failure, rewrite compose with previous tag and restart
- DOCKERFILE_EXAMPLES.md: add non-root user (USER app) to Python, Go,
  Rust, Java examples to match the Node example's USER node pattern
@heznpc heznpc merged commit 15d7485 into main Apr 23, 2026
3 checks passed
@heznpc heznpc deleted the feat/cd-rollback-nonroot branch April 23, 2026 16:28
@heznpc heznpc mentioned this pull request Apr 23, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant